package qgs.zisu.javaconcurrency.javaconcurrency.chapter2;

/**
 * @Author: 蔡翔
 * @Date: 2019/9/6 10:28
 * @Version 1.0
 */
public class TaxCalculatorMain {
    public static void main(String[] args) {
        /*TaxCalaculator calaculator = new TaxCalaculator(1000d,2000d){
            @Override
            public double calcTax() {
                return getSalary()*0.1+getBonus()*0.15;
            }
        };
        double tax = calaculator.calculate();

        System.out.println(tax);*/

        TaxCalaculator calaculator = new TaxCalaculator(10000d,2000d);
        CalculatorStrategy calculatorStrategy = new SimpleCalculatorStrategy();
        calaculator.setCalculatorStrategy(calculatorStrategy);
        System.out.println(calaculator.calcTax());

    }
}
